<template>


  <div id="aplayer"></div>


</template>

<script>
import 'aplayer/dist/APlayer.min.css';
import Evenbus from "../../../evenbus";
import APlayer from 'aplayer';

export default {
  name: "Test",
  data() {
    return {
      playdata: [],
    }
  },
  mounted() {
    const ap = new APlayer({
      container: document.getElementById('aplayer'),
      /*mini: false,*/
      autoplay: false,
      theme: '#FADFA3',
      loop: 'all',
      order: 'random',
      preload: 'auto',
      volume: 0.7,
      mutex: true,
      listFolded: false,
      listMaxHeight: 90,
      lrcType: 3,
      fixed: true, // 不开启吸底模式
      audio: [
        /*{
          name: this.playdata.name,
          artist: this.playdata.artist,
          url: this.playdata.playurl,
          /!*cover: 'cover1.jpg',
          lrc: 'lrc1.lrc',
          theme: '#ebd0c2'*!/
        },*/
        /* {
           name: 'name2',
           artist: 'artist2',
           url: 'url2.mp3',
           cover: 'cover2.jpg',
           lrc: 'lrc2.lrc',
           theme: '#46718b'
         }*/
      ]
    });
    Evenbus.$on("data", data => {
      this.playdata = data
      console.log(this.playdata.name)
      ap.list.add([{
        name: this.playdata.name,
        artist: this.playdata.artist,
        url: this.playdata.playurl,
      }])
    })

    // 初始化播放器

  },

  methods: {}
}


</script>

<style scoped>

</style>
